package com.project.constants;

import com.project.common.exception.ErrorSupport;

public class ErrorCode implements ErrorSupport {

    public static final ErrorCode ERR_BASE_ERR = new ErrorCode("90001", "未知异常!");
    public static final ErrorCode ERR_MISS_PARAM_ERROR = new ErrorCode("400", "缺少参数:{0} {1} .");
    public static final ErrorCode ERR_MISS_PARAM_TYPE_ERROR = new ErrorCode("400", "参数:{0} 值类型错误 .");
    public static final ErrorCode ERR_REQUEST_METHOD_ERROR = new ErrorCode("405", "Method {0} 不被支持,正确的应该是: {1} .");
    public static final ErrorCode ERR_404 = new ErrorCode("404", "404 (#^.^#) 迷路了!  {0}  {1}");

    public static final ErrorCode ERR_SERVER_ERR = new ErrorCode("100000", "服务器异常!");
    public static final ErrorCode PARAM_ERROR = new ErrorCode("100500", "参数错误");

    private String code;

    private String errorMessage;

    ErrorCode(String code, String errorMessage) {
        this.code = code;
        this.errorMessage = errorMessage;
    }

    public String getCode() {
        return code;
    }

    @Override
    public String getErrorMessage() {
        return errorMessage;
    }


}
